#pragma once

class Camera : public Singleton<Camera>
{
	D3DXVECTOR3 m_cam, m_tar, m_up;
	LPD3DXMESH m_skySphere;
	bool CheckKeys();
	ui32 m_lastCheck;
	D3DXMATRIX m_matView;
	Vertex2F m_mouseLast;
	bool m_posChanged;
public:
	Camera();
	void Render();
	void OnMouseWheel(i16 delta);
	Vertex3F GetCamPosition() { return Vertex3F(m_cam.x, m_cam.y, m_cam.z); }
	Vertex3F GetTargetPosition() { return Vertex3F(m_tar.x, m_tar.y, m_tar.z); }
	void SetCameraPosition(float x, float y, float z);
	D3DXMATRIX& GetMatView() { return m_matView; }
	void OnMouseMove(Vertex2F pos);
	void UpdatePos(Vertex2F pos) { m_mouseLast = pos; }
};

#define sCamera (*Camera::GetInstance())